const Koa = require("koa")
const app = new Koa()

const middleware1 = function async(ctx, next){
  // console.log(ctx.request.path)
  console.log('this is a middleware1')
  next()
  console.log('middleware1 ending')
}

const middleware2 = function async(ctx, next){
  // console.log(ctx.request.path)
  console.log('this is a middleware2')
  // next()
  // console.log('middleware2 ending')
}

const middleware3 = function async(ctx, next){
  // console.log(ctx.request.path)
  console.log('this is a middleware3')

}

app.use(middleware1)
   .use(middleware2)
   .use(middleware3)

app.listen(3000)



